package entity

import (
	"time"
)

// Role [...]
type Role struct {
	ID        uint64    `gorm:"primaryKey;column:id" json:"-"`
	CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
	Name      string    `gorm:"column:name" json:"name"`         // 权限名称
	Sequence  int64     `gorm:"column:sequence" json:"sequence"` // 排序
	Memo      string    `gorm:"column:memo" json:"memo"`         // 备注
	Status    bool      `gorm:"column:status" json:"status"`     // 0:禁用|1:启用
	Creator   uint64    `gorm:"column:creator" json:"creator"`
}

// TableName get sql table name.获取数据库表名
func (m *Role) TableName() string {
	return "role"
}

// RoleColumns get sql column name.获取数据库列名
var RoleColumns = struct {
	ID        string
	CreatedAt string
	UpdatedAt string
	Name      string
	Sequence  string
	Memo      string
	Status    string
	Creator   string
}{
	ID:        "id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	Name:      "name",
	Sequence:  "sequence",
	Memo:      "memo",
	Status:    "status",
	Creator:   "creator",
}
